package com.francis.pattern.factory.simplefactory;

import com.francis.pattern.factory.EnglishCourse;
import com.francis.pattern.factory.ICourse;
import com.francis.pattern.factory.MathCourse;

/**
 * @Author Francis
 * @Date 2020/10/26 22:24
 * @Version 1.0
 */
public class CourseFactory {
     public static ICourse creat(String name){
         if("math".equals(name)){
             return new MathCourse();
         }else if ("english".equals(name)){
             return new EnglishCourse();
         }else{
             return null;
         }
     }
}
